package com.shanzhe.eshop.common.jdk;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Iterator;
import java.util.concurrent.CopyOnWriteArrayList;
import java.util.concurrent.LinkedBlockingQueue;

/**
 * @Author yinwei
 * @create 2021/12/15
 * @Version 1.0
 */
public class CopyOnWriteArrayListDemo {

    public static void main(String[] args) {
        CopyOnWriteArrayList<String> writeArrayList = new CopyOnWriteArrayList<String>();
        writeArrayList.add("张三");
        writeArrayList.set(0,"李四");
        writeArrayList.remove(0);

         ArrayList<String> list = new ArrayList<String>();

        final Iterator<String> iterator = writeArrayList.iterator();
        while (iterator.hasNext()){
        }
    }
}
